//
//  WritingViewCell.m
//  LineByLine
//
//  Created by 병철 김 on 11. 10. 25..
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "WritingViewCell.h"
#import "CommonDefine.h"
#import "WordManager.h"


@implementation WritingViewCell
@synthesize sentence, wordsViewDelegate;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        targetText = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, kContentWidth, 100)];
        wordsView = [[WordsView alloc] initWithFrame:CGRectMake(0, 100, kContentWidth, 276)];

        [targetText setFont:[UIFont systemFontOfSize:18]];
        [targetText setContentInset:UIEdgeInsetsMake(5, 10, 5, 5)];
        [targetText setEditable:NO];
        [targetText setBackgroundColor:[UIColor redColor]];
        
        [self.contentView addSubview:wordsView];
        [self.contentView addSubview:targetText];
        
        [targetText release];
        [wordsView release];
    }
    return self;
}

- (void) configView {
    [targetText setText:[sentence valueForKey:@"b"]];
    [wordsView setSentence:sentence];
    [wordsView setViewDelegate:wordsViewDelegate];
    [wordsView configView];
}
@end
